#include<iostream>
#include<vector>

using namespace std;


int singleNumber(vector<int>& nums) {
    int ans = 0;
    for (int i = 0; i < 32; ++i) {
        int total = 0;
        for (int num : nums) {
            total += ((num >> i) & 1);
        }
        if (total % 3) {
            ans |= (1 << i);
        }
    }
    return ans;

}

int main()
{
	vector<int> v;
	v.push_back(2);
	v.push_back(2);
	v.push_back(2);
	v.push_back(3);


    int ret = singleNumber(v);

	return 0;
}